<?php
/*
 * Created on 04.07.2009
 *
 * @author Alexey A. Frolov <frolov.alexey@gmail.com>
 */
 
 function __autoload($class)
 {
 	if (!defined('TIGER_PATH')) trigger_error('Configuration file is not complete. Undefined constant TIGER_PATH', E_USER_ERROR);
	$classes = array(
	
	// core
	'TApplication'			=> 'core/TApplication.class',
	'TClass'				=> 'core/TClass.class',
	'TControl'				=> 'core/TControl.class',
	'TComponent'			=> 'core/TComponent.class',
	'TException'			=> 'core/TException.class',
	'TModule'				=> 'core/TModule.class',
	'TPage'					=> 'core/TPage.class',
	'TPageControl'			=> 'core/TPageControl.class',
	'TPageService'			=> 'core/TPageService.class',

	// core/interfaces
	'IComponent'				=> 'core/interfaces/TIComponent.interface',
	'IControl'					=> 'core/interfaces/TIControl.interface',
	'IModule'					=> 'core/interfaces/TIModule.interface',
	'IWebControl'				=> 'core/interfaces/TIWebControl.interface',
	
	// utils
	'TTagParser'			=>	'utils/TTagParser.class',
	);

	if (isset($classes[$class]) && $classes[$class] && file_exists(TIGER_PATH . $classes[$class] . '.php'))
		include_once(TIGER_PATH . $classes[$class] . '.php');
	else
		trigger_error('Framework class '.$class.' does not exist', E_USER_ERROR);
 }
?>